<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="resources/css/style.css">
<title>Insert title here</title>
<script type="text/javascript">
	function send() {
		$("#fileError").html("");
		$("#quantitaError").html("");
		if($("#file").val() == null || $("#file").val() == "" || $("#file").val() == "undefined") {
			$("#fileError").html("Nessun file");
			$("#file").focus();
			return false;
		}
		if(isNaN($("#quantita").val()) || $("#quantita").val() == 0) {
			$("#quantitaError").html("Quantit&agrave; vuota o uguale a zero");
			$("#quantita").focus();
			return false;
		}
		$("#form").submit();
	}
</script>
</head>
<body>
	<div class="box">
		<form id="form" action="printForUser.htm" method="post" enctype="multipart/form-data">
			<table>
				<tr>
					<td>File</td><td><input type="file" id="file" name="file" value="Scegli il file"></td><td id="fileError"></td>
				</tr>
				<tr>
					<td>Quantit&agrave;</td><td><input type="text" name="quantita" id="quantita"></td><td id="quantitaError"></td>
				</tr>
				<tr>
					<td><input type="button" onclick="send()" value="Send"></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>